﻿using System;

namespace NazTek.Utility
{
    /// <summary>
    /// Encapsulates arguments for notification events publishing/subscribing.
    /// </summary>
    public class NoticeEventArgs : EventArgs
    {
        /// <summary>
        /// Gets/sets notification message.
        /// </summary>
        public string Message { get; private set; }
        /// <summary>
        /// Gets message with timestamps.
        /// </summary>
        public string StampedMessage
        {
            get { return string.Format("[{0}] {1}", OccurredAt, Message); }
        }
        /// <summary>
        /// Creates timestamped notification message.
        /// </summary>
        /// <param name="message">Message to set for notification.</param>
        public NoticeEventArgs(string message)
        {
            Message = message;
            OccurredAt = DateTime.Now;
        }

        /// <summary>
        /// Gets/sets event occurrence timestamps.
        /// </summary>
        private DateTime OccurredAt { get; set; }
    }
}